/*
 * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Eike Stepper - initial API and implementation
 */
package org.eclipse.emf.extensions;


public abstract class DBField implements IDBField {
    public static final int DEFAULT_DECIMAL_PRECISION=5;

    public static final int DEFAULT_SCALE=0;

    public static final int DEFAULT_CHAR_LENGTH=1;

    public static final int DEFAULT_VARCHAR_LENGTH=255;

    private final DBTable table;

    private final IDBFieldDescriptor descriptor;

    protected DBField(DBTable table, IDBFieldDescriptor descriptor) {
        this.table=table;
        this.descriptor=descriptor;
    }

    protected IDBSchema getSchema() {
        return table.getSchema();
    }

    @Override
    public DBTable getTable() {
        return table;
    }

    @Override
    public IDBFieldDescriptor getDescriptor() {
        return descriptor;
    }
}
